package cn.nabaixin;

import android.app.TabActivity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import cn.nabaixin.discover.DiscoverActivity;
import cn.nabaixin.friend.FriendActivity;
import cn.nabaixin.latest.LatestActivity;
import cn.nabaixin.mine.MineActivity;
import cn.nabaixin.sign.SignActivity;

public class QK_Main extends TabActivity {
    /** 程序启动界面 */
	private TabHost mTabHost;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //自定义标题栏
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 
        setContentView(R.layout.main);                                    
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title);
        //添加Tab
        mTabHost = getTabHost();
        
        Drawable icon = getResources().getDrawable(R.drawable.icon_latest);
        TabSpec ts1 = mTabHost.newTabSpec("tag1").setIndicator("动态", icon).setContent(new Intent(this, LatestActivity.class));
        mTabHost.addTab(ts1);
        
        icon = getResources().getDrawable(R.drawable.icon_sign);
        TabSpec ts2 = mTabHost.newTabSpec("tag2").setIndicator("签到", icon).setContent(new Intent(this, SignActivity.class));
        mTabHost.addTab(ts2);
        
        icon = getResources().getDrawable(R.drawable.icon_discover);
        TabSpec ts3 = mTabHost.newTabSpec("tag3").setIndicator("探索", icon).setContent(new Intent(this, DiscoverActivity.class));
        mTabHost.addTab(ts3);
        
        /*icon = getResources().getDrawable(R.drawable.icon_friend);
        TabSpec ts4 = mTabHost.newTabSpec("tag4").setIndicator("好友", icon).setContent(new Intent(this, FriendActivity.class));
        mTabHost.addTab(ts4);*/
        
        icon = getResources().getDrawable(R.drawable.icon_myself);
        TabSpec ts5 = mTabHost.newTabSpec("tag5").setIndicator("我的", icon).setContent(new Intent(this, MineActivity.class));
        mTabHost.addTab(ts5);
        
       /* 
        addNewTab("动态", R.drawable.icon, LatestActivity.class, "0");
        addNewTab("签到", R.drawable.icon, LatestActivity.class, "1");
        addNewTab("探索", R.drawable.icon, LatestActivity.class, "2");
        addNewTab("我的", R.drawable.icon, LatestActivity.class, "3");
        //设置Tab高度
        setTabWidgetHeight(60);*/
        
    }
}